package com.smart.lx.singleton.threadlocal;
/**
 * 功能描述: <br>
 * 〈注册-枚举〉
 * <p>
 * threadlocal 单例
 *
 * @since: 1.0.0
 * @Author:abc
 * @Date: 2019/3/10
 */
public class ThreadLocalSingleton {
    private static final ThreadLocal<ThreadLocalSingleton> threadLocalInstance =
            new ThreadLocal<ThreadLocalSingleton>(){
                @Override
                protected ThreadLocalSingleton initialValue() {
                    return new ThreadLocalSingleton();
                }
            };

    private ThreadLocalSingleton(){}

    public static ThreadLocalSingleton getInstance(){
        return threadLocalInstance.get();
    }
}
